local sim = Player:addState("sim")

function sim:enteredState()
	print("player entered state sim")
end

function sim:keypressed(key, isRepeat)
	--[[
	if key == "up" then
		game.camera.moveY = -1
	elseif key == "down" then
		game.camera.moveY = 1
	elseif	key == "right" then
		game.camera.moveX = 1
	elseif key == "left" then
		game.camera.moveX = -1
	end
	]]
	if key == "kp+" then
		if game.maps[game.current_map+1] then
			game:set_level(game.current_map+1)
		end
	end

	if key == "kp-" then
		if game.maps[game.current_map-1] then
			game:set_level(game.current_map-1)
		end
	end

	if key == "b" then
		debug.debug()
	end
end

function sim:keyreleased(key)
	if key == "up" or key == "down" then
		game.camera.moveY = 0
	elseif key == "left" or key == "right" then
		game.camera.moveX = 0
	end
end

function sim:mousepressed(x, y, button)

	local tile = game:get_tile(x, y)
	if tile then
		print(tile.resource .. " selected")
	end

end

function sim:mousereleased(x, y, button)

end

function sim:exitedState()
	print("player exited state sim")
end